﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace dbUtils.dto
{
    public class User : objdto
    {
#region PROP
        public const int TYPE_ADMIN = 0;
        public const int TYPE_DEFL_MEMBER = 1;
        public const int TYPE_EMPLOYEE = 2;
        public const int ID_ERROR = -1;

        int _id;
        string _uname;
        string _upass;
        string _sdt;
        string _cmnd;
        string _email;
        string _hoten;
        int _type;
#endregion
#region CONSTRUCTOR
        public User()
        {
            _objType = OBJ_TYPE_USER;
            _uname = string.Empty;
            _upass = string.Empty;
            _sdt = string.Empty;
            _cmnd = string.Empty;
            _email = string.Empty;
            _hoten = string.Empty;
            _type = TYPE_DEFL_MEMBER;
        }

        public User(string uname, string upass, string sdt, string cmnd, string email, string hoten, int type)
        {
            _objType = OBJ_TYPE_USER;
            _uname = uname;
            _upass = upass;
            _sdt = sdt;
            _cmnd = cmnd;
            _email = email;
            _hoten = hoten;
            _type = (type==TYPE_ADMIN)?TYPE_ADMIN:((type==TYPE_EMPLOYEE)?TYPE_EMPLOYEE:TYPE_DEFL_MEMBER);
        }

        public User(string uname, string upass, string sdt, string cmnd, string email, string hoten)
        {
            _objType = OBJ_TYPE_USER;
            _uname = uname;
            _upass = upass;
            _sdt = sdt;
            _cmnd = cmnd;
            _email = email;
            _hoten = hoten;
            _type = TYPE_DEFL_MEMBER;
        }
#endregion

        public int Type
        {
            get { return _type; }
            set { _type = value; }
        }

        public string Hoten
        {
            get { return _hoten; }
            set { _hoten = value; }
        }

        public string Email
        {
            get { return _email; }
            set { _email = value; }
        }

        public string Cmnd
        {
            get { return _cmnd; }
            set { _cmnd = value; }
        }

        public string Sdt
        {
            get { return _sdt; }
            set { _sdt = value; }
        }

        public string Password
        {
            get { return _upass; }
            set { _upass = value; }
        }

        public string UserName
        {
            get { return _uname; }
            set { _uname = value; }
        }

        public int Id
        {
            get { return _id; }
        }
    }
}
